<template>
  <div class="duihua">
    <h4>你还可以兑换</h4>
    <ul class="r-huan">
      <li
        class="pro-huan flex"
        v-for="item in themYouCanBuy"
        :key="item.id"
        @click="detailItem(item)"
      >
        <div class="r-img">
          <img :src="item.img |srcFormat" alt="" />
        </div>
        <div class="text">
          <p class="ellipsis">{{ item.name }}</p>
          <p class="r-count">
            <span>{{ item.coin }}</span>
            <img src="../../assets/images/home/monad.png" alt="" />
          </p>
        </div>
      </li>
    </ul>
  </div>
</template>
 
<script>
export default {
  props: ["themYouCanBuy"],
  data() {
    return {};
  },
  methods: {
    detailItem(item) {
      console.log(item.id);
      this.$router.push(`/goodsdetail?id=${item.id}`);
    },
  },
};
</script>
 
<style lang = "less" scoped>
.duihua {
  h4 {
    height: 17px;
    font-size: 18px;
    font-weight: 400;
    color: #333333;
    margin: 20px 0;
  }
  .r-huan li {
    cursor: pointer;
  }
  .r-img {
    width: 80px;
    margin-right: 20px;
    img {
      width: 100%;
    }
  }
  .pro-huan {
    margin-bottom: 10px;
  }
  .text {
    font-size: 14px;
    font-weight: 300;
    color: #666;
    line-height: 20px;
    padding-top: 20px;
    .r-count {
      span {
        font-size: 18px;
        font-weight: bold;
        color: #ff5e0f;
        line-height: 40px;
        margin-right: 6px;
      }
      img {
        width: 20px;
        height: 20px;
      }
    }
  }
}
</style>